Game AI


Game AI best fits within the scope of weak AI. Wide-ranging interpretations of game AI exist. A broad interpretation includes everything - simple chasing and evading, pattern movement, neural networks, and genetic algorithms. Game AI techniques generally fall under deterministic AI or nondeterministic AI.

(AI for Game Developers by David M. Bourg and Glenn Seeman, 2004. Page 21, 24)

Compared to academic AI researchers, game AI programmers are more focused with having a fun outcome, have to work with limited resources, and accept compromises in order to get an acceptable level of performance.

If the player believes the agent he's playing against is intelligent, then it's intelligent. Design agents that provide the illusion of intelligence. Be careful to maintain that illusion. Avoid AI running into walls, getting stuck in corners, not reacting to obvious stimuli. Avoid "cheating" - no seeing through walls, requiring less gold to build units than the human player, hearing a pin drop at 500 meters.

(Programming Game AI by Example by Mat Buckland, 2005. Page xix-xx)

To be entertaining, AI needs to be designed to be suboptimal to avoid being unfair or frustrating the player. AI should put up a good fight but lose more often than win. It should let the player feel clever, sly, cunning, and powerful.

(Programming Game AI by Example by Mat Buckland, 2005. Page xix - xx)

Fields

  • Physics
  • Trigonometry: Sine, Cosine, Tangent
  • Vector Math: Dot Product, Normalizing a Vector

Techniques

Examples

  • Halo's AI designers found that playtesters were fooled into thinking the AI agents were more intelligent simply by increasing their number of hit points. With low HP, 36% felt AI was too easy and 8% felt AI very intelligent. With higher HP, 0% felt AI too easy and 43% felt AI very intelligent.
  • Visual and auditory clues as to what the agent is "thinking" about gives off a perception of higher intelligence. If player suddenly enters room, agent should act startled. Have agent track the movement of neighboring agents with its head. If stealth and agent hears something suspicious, mumble "What was that?" or "Is anyone there?"

(Programming Game AI by Example by Mat Buckland, 2005. Page xx)

Resources

  • Introduction to Game AI - Ian Millington

Godot

  • https://godotengine.org/qa/13647/how-to-make-a-zombie-follow-the-player
  • https://godotengine.org/qa/31404/enemy-ai-following-player
  • https://godotengine.org/qa/14678/enemy-ai-follow-player-without-getting-stuck-on-walls
  • https://godotengine.org/qa/10928/how-to-create-basic-ai-that-follows-the-player-if-spotted-in-3d